<div class="container">
	<ol class="breadcrumb">
		<li><?php echo anchor('', 'Início'); ?></li>
		<li><?php echo anchor('parasuaempresa', 'Para Sua Empresa'); ?></li>
		<li class="active">Cadastrar minha empresa</li>
	</ol>
</div>

<div class="container">

	<?php 
		$hidden = array('datetime' => date('Ymdhmi'));
		$attributes = array("role"=>"form");
		echo form_open('parasuaempresa/home/cadastro', $attributes, $hidden); 
	?>

	<h3 class="titulos">Cadastrar minha empresa</h3>

	<?php
		if(!empty($formMessage)){
			$cssOptions = array('alert-danger', 'alert-warning', 'alert-success');
			$cssAlert = $cssOptions[$formMessage[0]-1];
	?>
	<div class="alert <?php echo $cssAlert; ?>">
		<?php echo $formMessage[1]; ?>
	</div>
	<?php
		}
	?>

	<div class="row">
		<div class="col-sm-3 form-group">
			<label for="cnpj">CNPJ</label>
			<?php echo form_input(array('name'=>'cnpj','id'=>'cnpj','class'=>'form-control', 'value' => $formData['cnpj'])); ?>
		</div>

		<div class="col-sm-3 form-group">
			<label for="insc_estadual">Insc Estadual</label>
			<?php echo form_input(array('name'=>'insc_estadual','id'=>'insc_estadual','class'=>'form-control', 'value' => $formData['insc_estadual'])); ?>
		</div>

		<div class="col-sm-3 form-group">
			<label for="razao_social">Razão Social</label>
			<?php echo form_input(array('name'=>'razao_social','id'=>'razao_social','class'=>'form-control', 'value' => $formData['razao_social'])); ?>
		</div>

		<div class="col-sm-3 form-group">
			<label for="nome_fantasia">Nome Fantasia</label>
			<?php echo form_input(array('name'=>'nome_fantasia','id'=>'nome_fantasia','class'=>'form-control', 'value' => $formData['nome_fantasia'])); ?>
		</div>
	</div>
	
	<div class="row">
		<div class="col-sm-3 form-group">
			<label for="telefone">Telefone</label>
			<?php echo form_input(array('name'=>'telefone','id'=>'telefone','class'=>'form-control', 'value' => $formData['telefone'])); ?>
		</div>
		<div class="col-sm-3 form-group">
			<label for="celular">Celular</label>
			<?php echo form_input(array('name'=>'celular','id'=>'celular','class'=>'form-control', 'value' => $formData['celular'])); ?>
		</div>
		<div class="col-sm-3 form-group">
			<label for="responsavel">Nome responsável</label>
			<?php echo form_input(array('name'=>'responsavel','id'=>'responsavel','class'=>'form-control', 'value' => $formData['responsavel'])); ?>
		</div>
		<div class="col-sm-3 form-group">
			<label for="site">Site</label>
			<?php echo form_input(array('name'=>'site','id'=>'site','class'=>'form-control', 'value' => $formData['site'])); ?>
		</div>
	</div>

	<div class="row">
		<div class="col-sm-3 form-group">
			<label for="segmento">Principal segmento</label>
			<?php
				$seg = array(''=>'');

				foreach ($segmentos as $segmento) {
					$seg[$segmento->cod_segmento_auto] = $segmento->desc_segmento;
				}

				echo form_dropdown('segmento', $seg, '', 'id="segmento" class="form-control"');
			?>
		</div>
	</div>

	<h5>Endereço</h5>

	<div class="row">
		<div class="col-sm-4 form-group">
			<label for="endereco">Endereço</label>
			<?php echo form_input(array('name'=>'endereco','id'=>'endereco','class'=>'form-control', 'value' => $formData['endereco'])); ?>
		</div>
		<div class="col-sm-2 form-group">
			<label for="numero">Número</label>
			<?php echo form_input(array('name'=>'numero','id'=>'numero','class'=>'form-control', 'value' => $formData['numero'])); ?>
		</div>
		<div class="col-sm-3 form-group">
			<label for="bairro">Bairro</label>
			<?php echo form_input(array('name'=>'bairro','id'=>'bairro','class'=>'form-control', 'value' => $formData['bairro'])); ?>
		</div>
		<div class="col-sm-3 form-group">
			<label for="cep">CEP</label>
			<?php echo form_input(array('name'=>'cep','id'=>'cep','class'=>'form-control', 'value' => $formData['cep'])); ?>
		</div>
	</div>

	<div class="row">
		<div class="col-sm-2 form-group">
			<label>Estado</label>
			<?php
			$ufs = array();
			//$ufs[''] = '';

			foreach ($estados->result() as $estado) {
				$ufs[$estado->sigla_uf] = $estado->sigla_uf;
			}

			echo form_dropdown('estado', $ufs, 'SC', 'id="estado" class="form-control"');
			?>
		</div>

		<div class="col-sm-4 form-group">
			<label>Cidade</label>
			<?php
			$cid = array();
			//$cid[''] = '';

			foreach ($cidades->result() as $cidade) {
				$cid[$cidade->cod_cidade_auto] = $cidade->desc_cidade;
			}

			echo form_dropdown('cidade', $cid, 'Joinville', 'id="cidade" class="form-control"');
			?>
		</div>
	</div>

	<h5>Dados de acesso</h5>

	<div class="row">
		<div class="col-sm-3 form-group">
			<label for="email">Email</label>
			<?php echo form_input(array('name'=>'email','id'=>'email','class'=>'form-control', 'value' => $formData['email'])); ?>
		</div>
		<div class="col-sm-3 form-group">
			<label for="confirmar_email">Confirmar Email</label>
			<?php echo form_input(array('name'=>'confirmar_email','id'=>'confirmar_email','class'=>'form-control')); ?>
		</div>

		<div class="col-sm-3 form-group">
			<label for="senha">Senha</label>
			<?php echo form_password(array('name'=>'senha','id'=>'senha','class'=>'form-control')); ?>
		</div>

		<div class="col-sm-3 form-group">
			<label for="confirmar_senha">Confirmar Senha</label>
			<?php echo form_password(array('name'=>'confirmar_senha','id'=>'confirmar_senha','class'=>'form-control')); ?>
		</div>
	</div>	

	<input type="submit" class="btn btn-primary pull-right" value="Cadastrar" />

	<?php echo form_close(); ?>

</div>